import request from "@/utils/request";

export function getNewSongs() {
  return request({
    url: "/song/song/getNewSongs",
    method: "get",
  });
}

//实时推荐
export function getOnLineRecommendSongs(data) {
  return request({
    url: "/song/song/getOnLineRecommendSongs",
    method: "post",
    data: data,
  });
}

//离线推荐
export function getOffLineRecommendSongs(userId) {
  return request({
    url: "/song/song/getOffLineRecommendSongs/" + userId,
    method: "get",
  });
}


export function getEachTypeSongListCount() {
  return request({
    url: "/song/song/getEachTypeSongListCount",
    method: "get",
  });
}

export function addLikeType(data) {
  return request({
    url: "/song/song/addLikeType",
    method: "post",
    data: data,
  });
}

export function getMusicType() {
  return request({
    url: "/song/song/getMusicType",
    method: "get",
  });
}
export function getLikeTypeMusic(userId) {
  return request({
    url: "/song/song/getLikeTypeMusic/" + userId,
    method: "get",
  });
}

// 根据歌手id查询歌曲列表
export function getSongListBySingerId(singerId) {
  return request({
    url: "/song/song/getSongListBySingerId/" + singerId,
    method: "get",
  });
}

// 获取热门歌曲列表
export function getHotSongList() {
  return request({
    url: "/song/song/getHotSongList",
    method: "get",
  });
}

// 根据专辑id查询歌曲列表
export function getSongListByAlbumId(albumId) {
  return request({
    url: "/song/song/listByAlbumId/" + albumId,
    method: "get",
  });
}

// 根据用户id查询收藏列表
export function listFavoriteByUserId(userId) {
  return request({
    url: "/song/song/listFavoriteByUserId/" + userId,
    method: "get",
  });
}
// 根据用户id查询历史播放列表
export function listHistoryByUserId(userId) {
  return request({
    url: "/song/song/listHistoryByUserId/" + userId,
    method: "get",
  });
}

// 查询音乐信息列表
export function listSong(query) {
  return request({
    url: "/song/song/list",
    method: "get",
    params: query,
  });
}

// 查询音乐信息详细
export function getSong(songId) {
  return request({
    url: "/song/song/" + songId,
    method: "get",
  });
}

// 新增音乐信息
export function addSong(data) {
  return request({
    url: "/song/song",
    method: "post",
    data: data,
  });
}

// 修改音乐信息
export function updateSong(data) {
  return request({
    url: "/song/song",
    method: "put",
    data: data,
  });
}

// 删除音乐信息
export function delSong(songId) {
  return request({
    url: "/song/song/" + songId,
    method: "delete",
  });
}

// 删除音乐信息
export function getWaitingSongList(songIds) {
  return request({
    url: "/song/song/getWaitingSongList",
    method: "post",
    data: songIds,
  });
}
